package com.dmn.gcode.springchains.adapters;

import com.dmn.gcode.springchains.core.Link;

/**
 * date 2/2/11
 *
 * todo implements In !
 * @author dvponomarev
 * @version 1.0
 */
public class OrBooleanConstantAdapter extends Link<Boolean> {
    private Boolean first;
    private Boolean second;

    public void setFirst(Boolean first) {
        this.first = first;
        setIt();
    }

    public void setSecond(Boolean second) {
        this.second = second;
        setIt();
    }

    private void setIt() {
        if (first != null && second != null) {
            this.object = first || second;
        }
    }

    @Override
    public void set(Boolean aBoolean) throws Exception {
        throw new IllegalStateException();
    }
}
